﻿@model CustomerUserSettingsModel
@using SmartStore.Core.Domain.Customers;
@{
    ViewBag.Title = T("Admin.Configuration.Settings.CustomerUser").Text;
}
@using (Html.BeginForm())
{
    <div class="section-header">
        <div class="title">
            <i class="fa fa-users"></i>
            @T("Admin.Configuration.Settings.CustomerUser")
        </div>
        <div class="options">
            <button type="submit" name="save" value="save" class="btn btn-warning">
				<i class="fa fa-check"></i>
				<span>@T("Admin.Common.Save")</span>
			</button>
        </div>
    </div>

    Html.RenderAction("StoreScopeConfiguration", "Setting");

    @Html.ValidationSummary(false)
	
    @Html.SmartStore().TabStrip().Name("customersettings-edit").Style(TabsStyle.Material).Position(TabsPosition.Top).Items(x =>
    {
		x.Add().Text(T("Admin.Configuration.Settings.CustomerUser.CustomerSettings").Text).Content(TabCustomerSettings()).Selected(true);
		x.Add().Text(T("Admin.Configuration.Settings.CustomerUser.CustomerFormFields").Text).Content(TabCustomerFormFields().ToHtmlString());
		x.Add().Text(T("Admin.Configuration.Settings.CustomerUser.AddressFormFields").Text).Content(TabAddressFormFields().ToHtmlString());
		x.Add().Text(T("Admin.Configuration.Settings.CustomerUser.DateTimeSettings").Text).Content(TabDateTimeSettings());
		x.Add().Text(T("Admin.Configuration.Settings.CustomerUser.ExternalAuthenticationSettings").Text).Content(TabExternalAuthenticationSettings());
		x.Add().Text(T("Admin.Configuration.Settings.CustomerUser.Privacy").Text).Content(TabPrivacy());
		EngineContext.Current.Resolve<IEventPublisher>().Publish(new TabStripCreated(x, "customersettings-edit", this.Html, this.Model));
	})
}

@helper TabCustomerSettings()
{
    <script type="text/javascript">
        $(function () {
        	$('#@Html.FieldIdFor(model => model.CustomerSettings.CustomerNumberMethod)').change(function () {
        		$('#pnlCustomerNumberVisibility').toggle($(this).val() !== '@(CustomerNumberMethod.Disabled.ToString())');
            }).trigger('change');

            $('#@Html.FieldIdFor(model => model.CustomerSettings.CustomerLoginType)').change(function () {
                $('#pnlUsernamesEnabled').toggle($(this).val() !== '@(CustomerLoginType.Email.ToString())');
            }).trigger('change');
        });
    </script>
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.CustomerLoginType)
            </td>
            <td class="adminData">
				@Html.DropDownListForEnum(model => model.CustomerSettings.CustomerLoginType)
                @Html.ValidationMessageFor(model => model.CustomerSettings.CustomerLoginType)
            </td>
        </tr>
		<tbody id="pnlUsernamesEnabled">
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(model => model.CustomerSettings.AllowUsersToChangeUsernames)
				</td>
				<td class="adminData">
					@Html.SettingEditorFor(model => model.CustomerSettings.AllowUsersToChangeUsernames)
					@Html.ValidationMessageFor(model => model.CustomerSettings.AllowUsersToChangeUsernames)
				</td>
			</tr>
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(model => model.CustomerSettings.CheckUsernameAvailabilityEnabled)
				</td>
				<td class="adminData">
					@Html.SettingEditorFor(model => model.CustomerSettings.CheckUsernameAvailabilityEnabled)
					@Html.ValidationMessageFor(model => model.CustomerSettings.CheckUsernameAvailabilityEnabled)
				</td>
			</tr>
		</tbody>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.CustomerSettings.CustomerNameFormat)
			</td>
			<td class="adminData">
				@Html.EnumSettingEditorFor(model => model.CustomerSettings.CustomerNameFormat)
				@Html.ValidationMessageFor(model => model.CustomerSettings.CustomerNameFormat)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.CustomerSettings.CustomerNameFormatMaxLength)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.CustomerNameFormatMaxLength)
				@Html.ValidationMessageFor(model => model.CustomerSettings.CustomerNameFormatMaxLength)
			</td>
		</tr>

		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.CustomerSettings.CustomerNumberMethod)
			</td>
			<td class="adminData">
				@Html.EnumSettingEditorFor(model => model.CustomerSettings.CustomerNumberMethod)
				@Html.ValidationMessageFor(model => model.CustomerSettings.CustomerNumberMethod)
			</td>
		</tr>
		<tr id="pnlCustomerNumberVisibility">
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.CustomerSettings.CustomerNumberVisibility)
			</td>
			<td class="adminData">
				@Html.EnumSettingEditorFor(model => model.CustomerSettings.CustomerNumberVisibility)
				@Html.ValidationMessageFor(model => model.CustomerSettings.CustomerNumberVisibility)
			</td>
		</tr>

        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.UserRegistrationType)
            </td>
            <td class="adminData">
				@Html.EnumSettingEditorFor(model => model.CustomerSettings.UserRegistrationType)
                @Html.ValidationMessageFor(model => model.CustomerSettings.UserRegistrationType)
            </td>
        </tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.CustomerSettings.DefaultPasswordFormat)
			</td>
			<td class="adminData">
				@Html.DropDownListFor(model => model.CustomerSettings.DefaultPasswordFormat, ((PasswordFormat)Model.CustomerSettings.DefaultPasswordFormat).ToSelectList())
				@Html.ValidationMessageFor(model => model.CustomerSettings.DefaultPasswordFormat)
			</td>
		</tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.RegisterCustomerRoleId)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.RegisterCustomerRoleId,
					Html.DropDownListFor(model => model.CustomerSettings.RegisterCustomerRoleId, Model.CustomerSettings.AvailableRegisterCustomerRoles, T("Common.Unspecified")))
                @Html.ValidationMessageFor(model => model.CustomerSettings.RegisterCustomerRoleId)
            </td>
        </tr>

        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.AllowCustomersToUploadAvatars)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.AllowCustomersToUploadAvatars, 
					Html.CheckBoxFor(model => model.CustomerSettings.AllowCustomersToUploadAvatars))
                @Html.ValidationMessageFor(model => model.CustomerSettings.AllowCustomersToUploadAvatars)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.ShowCustomersLocation)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.ShowCustomersLocation)
                @Html.ValidationMessageFor(model => model.CustomerSettings.ShowCustomersLocation)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.ShowCustomersJoinDate)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.ShowCustomersJoinDate)
                @Html.ValidationMessageFor(model => model.CustomerSettings.ShowCustomersJoinDate)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.AllowViewingProfiles)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.AllowViewingProfiles)
                @Html.ValidationMessageFor(model => model.CustomerSettings.AllowViewingProfiles)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.NotifyNewCustomerRegistration)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.NotifyNewCustomerRegistration)
                @Html.ValidationMessageFor(model => model.CustomerSettings.NotifyNewCustomerRegistration)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.HideDownloadableProductsTab)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.HideDownloadableProductsTab)
                @Html.ValidationMessageFor(model => model.CustomerSettings.HideDownloadableProductsTab)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.HideBackInStockSubscriptionsTab)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.HideBackInStockSubscriptionsTab)
                @Html.ValidationMessageFor(model => model.CustomerSettings.HideBackInStockSubscriptionsTab)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.HideNewsletterBlock)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.HideNewsletterBlock)
                @Html.ValidationMessageFor(model => model.CustomerSettings.HideNewsletterBlock)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.StoreLastVisitedPage)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.StoreLastVisitedPage)
                @Html.ValidationMessageFor(model => model.CustomerSettings.StoreLastVisitedPage)
            </td>
        </tr>
    </table>
}

@helper TabCustomerFormFields()
{
	<div class="alert alert-info alert-dismissible">
		@T("Admin.Configuration.Settings.CustomerUser.CustomerFormFields.Description")
		<button class="close" data-dismiss="alert">&times;</button>
	</div>
	
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.GenderEnabled)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.GenderEnabled)
                @Html.ValidationMessageFor(model => model.CustomerSettings.GenderEnabled)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.TitleEnabled)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.TitleEnabled)
                @Html.ValidationMessageFor(model => model.CustomerSettings.TitleEnabled)
            </td>
        </tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.CustomerSettings.FirstNameRequired)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.FirstNameRequired)
				@Html.ValidationMessageFor(model => model.CustomerSettings.FirstNameRequired)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.CustomerSettings.LastNameRequired)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.LastNameRequired)
				@Html.ValidationMessageFor(model => model.CustomerSettings.LastNameRequired)
			</td>
		</tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.DateOfBirthEnabled)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.DateOfBirthEnabled)
                @Html.ValidationMessageFor(model => model.CustomerSettings.DateOfBirthEnabled)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.CompanyEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.CompanyEnabled, 
					Html.CheckBoxFor(model => model.CustomerSettings.CompanyEnabled, new { data_toggler_for = "#pnlCompanyRequired" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.CompanyEnabled)
            </td>
        </tr>
        <tr id="pnlCompanyRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.CompanyRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.CompanyRequired)
                @Html.ValidationMessageFor(model => model.CustomerSettings.CompanyRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.StreetAddressEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.StreetAddressEnabled,
					Html.CheckBoxFor(model => model.CustomerSettings.StreetAddressEnabled, new { data_toggler_for = "#pnlStreetAddressRequired" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.StreetAddressEnabled)
            </td>
        </tr>
        <tr id="pnlStreetAddressRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.StreetAddressRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.StreetAddressRequired)
                @Html.ValidationMessageFor(model => model.CustomerSettings.StreetAddressRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.StreetAddress2Enabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.StreetAddress2Enabled,
					Html.CheckBoxFor(model => model.CustomerSettings.StreetAddress2Enabled, new { data_toggler_for = "#pnlStreetAddress2Required" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.StreetAddress2Enabled)
            </td>
        </tr>
        <tr id="pnlStreetAddress2Required">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.StreetAddress2Required)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.StreetAddress2Required)
                @Html.ValidationMessageFor(model => model.CustomerSettings.StreetAddress2Required)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.ZipPostalCodeEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.ZipPostalCodeEnabled,
					Html.CheckBoxFor(model => model.CustomerSettings.ZipPostalCodeEnabled, new { data_toggler_for = "#pnlZipPostalCodeRequired" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.ZipPostalCodeEnabled)
            </td>
        </tr>
        <tr id="pnlZipPostalCodeRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.ZipPostalCodeRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.ZipPostalCodeRequired)
                @Html.ValidationMessageFor(model => model.CustomerSettings.ZipPostalCodeRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.CityEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.CityEnabled,
					Html.CheckBoxFor(model => model.CustomerSettings.CityEnabled, new { data_toggler_for = "#pnlCityRequired" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.CityEnabled)
            </td>
        </tr>
        <tr id="pnlCityRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.CityRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.CityRequired)
                @Html.ValidationMessageFor(model => model.CustomerSettings.CityRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.CountryEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.CountryEnabled,
					Html.CheckBoxFor(model => model.CustomerSettings.CountryEnabled, new { data_toggler_for = "#pnlStateProvincEnabled" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.CountryEnabled)
            </td>
        </tr>
        <tr id="pnlStateProvincEnabled">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.StateProvinceEnabled)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.StateProvinceEnabled)
                @Html.ValidationMessageFor(model => model.CustomerSettings.StateProvinceEnabled)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.PhoneEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.PhoneEnabled,
					Html.CheckBoxFor(model => model.CustomerSettings.PhoneEnabled, new { data_toggler_for = "#pnlPhoneRequired" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.PhoneEnabled)
            </td>
        </tr>
        <tr id="pnlPhoneRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.PhoneRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.PhoneRequired)
                @Html.ValidationMessageFor(model => model.CustomerSettings.PhoneRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.FaxEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.CustomerSettings.FaxEnabled, 
					Html.CheckBoxFor(model => model.CustomerSettings.FaxEnabled, new { data_toggler_for = "#pnlFaxRequired" }))
                @Html.ValidationMessageFor(model => model.CustomerSettings.FaxEnabled)
            </td>
        </tr>
        <tr id="pnlFaxRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.FaxRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.FaxRequired)
                @Html.ValidationMessageFor(model => model.CustomerSettings.FaxRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.CustomerSettings.NewsletterEnabled)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.CustomerSettings.NewsletterEnabled)
                @Html.ValidationMessageFor(model => model.CustomerSettings.NewsletterEnabled)
            </td>
        </tr>
    </table>
}

@helper TabAddressFormFields()
{
	<div class="alert alert-info alert-dismissible">
		@T("Admin.Configuration.Settings.CustomerUser.AddressFormFields.Description")
		<button class="close" data-dismiss="alert">&times;</button>
	</div>
	
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.ValidateEmailAddress)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.ValidateEmailAddress)
                @Html.ValidationMessageFor(model => model.AddressSettings.ValidateEmailAddress)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.SalutationEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.SalutationEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.SalutationEnabled, new { data_toggler_for = "#pnlAddressSettingsSalutations" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.SalutationEnabled)
            </td>
        </tr>
    </table>

	<div id="pnlAddressSettingsSalutations">
		@(Html.LocalizedEditor<CustomerUserSettingsModel, CustomerUserSettingsLocalizedModel>("setting-customer-localized",
			@<table class="adminContent pnlSalutations">
				<tr>
					<td class="adminTitle">
						@Html.SmartLabelFor(model => model.Locales[item].Salutations)
					</td>
					<td class="adminData">
						@*IMPORTANT: Do not delete, this hidden element contains the id to assign localized values to the corresponding language *@
						@Html.HiddenFor(model => model.Locales[item].LanguageId)

						@Html.TextBoxFor(model => Model.Locales[item].Salutations)
						@Html.ValidationMessageFor(model => model.Locales[item].Salutations)
					</td>
				</tr>
			</table>
				,
			@<table class="adminContent pnlSalutations">
				<tr>
					<td class="adminTitle">
						@Html.SmartLabelFor(model => model.AddressSettings.Salutations)
					</td>
					<td class="adminData">
						@Html.TextBoxFor(model => model.AddressSettings.Salutations)
						@Html.ValidationMessageFor(model => model.AddressSettings.Salutations)
					</td>
				</tr>
			</table>
			))
	</div>

    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.TitleEnabled)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.TitleEnabled)
                @Html.ValidationMessageFor(model => model.AddressSettings.TitleEnabled)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.CompanyEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.CompanyEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.CompanyEnabled, new { data_toggler_for = "#pnlAddressCompanyRequired" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.CompanyEnabled)
            </td>
        </tr>
        <tr id="pnlAddressCompanyRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.CompanyRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.CompanyRequired)
                @Html.ValidationMessageFor(model => model.AddressSettings.CompanyRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.StreetAddressEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.StreetAddressEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.StreetAddressEnabled, new { data_toggler_for = "#pnlAddressStreetAddressRequired" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.StreetAddressEnabled)
            </td>
        </tr>
        <tr id="pnlAddressStreetAddressRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.StreetAddressRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.StreetAddressRequired)
                @Html.ValidationMessageFor(model => model.AddressSettings.StreetAddressRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.StreetAddress2Enabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.StreetAddress2Enabled,
					Html.CheckBoxFor(model => model.AddressSettings.StreetAddress2Enabled, new { data_toggler_for = "#pnlAddressStreetAddress2Required" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.StreetAddress2Enabled)
            </td>
        </tr>
        <tr id="pnlAddressStreetAddress2Required">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.StreetAddress2Required)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.StreetAddress2Required)
                @Html.ValidationMessageFor(model => model.AddressSettings.StreetAddress2Required)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.ZipPostalCodeEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.ZipPostalCodeEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.ZipPostalCodeEnabled, new { data_toggler_for = "#pnlAddressZipPostalCodeRequired" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.ZipPostalCodeEnabled)
            </td>
        </tr>
        <tr id="pnlAddressZipPostalCodeRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.ZipPostalCodeRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.ZipPostalCodeRequired)
                @Html.ValidationMessageFor(model => model.AddressSettings.ZipPostalCodeRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.CityEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.CityEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.CityEnabled, new { data_toggler_for = "#pnlAddressCityRequired" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.CityEnabled)
            </td>
        </tr>
        <tr id="pnlAddressCityRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.CityRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.CityRequired)
                @Html.ValidationMessageFor(model => model.AddressSettings.CityRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.CountryEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.CountryEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.CountryEnabled, new { data_toggler_for = "#pnlAddressStateProvinceEnabled" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.CountryEnabled)
            </td>
        </tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.AddressSettings.CountryRequired)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.CountryRequired)
				@Html.ValidationMessageFor(model => model.AddressSettings.CountryRequired)
			</td>
		</tr>
		<tbody id="pnlAddressStateProvinceEnabled">
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(model => model.AddressSettings.StateProvinceEnabled)
				</td>
				<td class="adminData">
					@Html.SettingEditorFor(model => model.AddressSettings.StateProvinceEnabled)
					@Html.ValidationMessageFor(model => model.AddressSettings.StateProvinceEnabled)
				</td>
			</tr>
			<tr>
				<td class="adminTitle">
					@Html.SmartLabelFor(model => model.AddressSettings.StateProvinceRequired)
				</td>
				<td class="adminData">
					@Html.SettingEditorFor(model => model.AddressSettings.StateProvinceRequired)
					@Html.ValidationMessageFor(model => model.AddressSettings.StateProvinceRequired)
				</td>
			</tr>
		</tbody>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.PhoneEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.PhoneEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.PhoneEnabled, new { data_toggler_for = "#pnlAddressPhoneRequired" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.PhoneEnabled)
            </td>
        </tr>
        <tr id="pnlAddressPhoneRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.PhoneRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.PhoneRequired)
                @Html.ValidationMessageFor(model => model.AddressSettings.PhoneRequired)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.FaxEnabled)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.AddressSettings.FaxEnabled,
					Html.CheckBoxFor(model => model.AddressSettings.FaxEnabled, new { data_toggler_for = "#pnlAddressFaxRequired" }))
                @Html.ValidationMessageFor(model => model.AddressSettings.FaxEnabled)
            </td>
        </tr>
        <tr id="pnlAddressFaxRequired">
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.AddressSettings.FaxRequired)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.AddressSettings.FaxRequired)
                @Html.ValidationMessageFor(model => model.AddressSettings.FaxRequired)
            </td>
        </tr>
    </table>
}

@helper TabDateTimeSettings()
{
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.DateTimeSettings.AllowCustomersToSetTimeZone)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.DateTimeSettings.AllowCustomersToSetTimeZone)
                @Html.ValidationMessageFor(model => model.DateTimeSettings.AllowCustomersToSetTimeZone)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.DateTimeSettings.DefaultStoreTimeZoneId)
            </td>
            <td class="adminData">
				@Html.SettingEditorFor(model => model.DateTimeSettings.DefaultStoreTimeZoneId, 
					Html.DropDownListFor(model => model.DateTimeSettings.DefaultStoreTimeZoneId, Model.DateTimeSettings.AvailableTimeZones))
                @Html.ValidationMessageFor(model => model.DateTimeSettings.DefaultStoreTimeZoneId)
            </td>
        </tr>
    </table>
}

@helper TabExternalAuthenticationSettings()
{
    <table class="adminContent">
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.ExternalAuthenticationSettings.AutoRegisterEnabled)
            </td>
            <td class="adminData">
                @Html.SettingEditorFor(model => model.ExternalAuthenticationSettings.AutoRegisterEnabled)
                @Html.ValidationMessageFor(model => model.ExternalAuthenticationSettings.AutoRegisterEnabled)
            </td>
        </tr>
    </table>
}

@helper TabPrivacy()
{
	<table class="adminContent">
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.PrivacySettings.EnableCookieConsent)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.PrivacySettings.EnableCookieConsent,
					Html.CheckBoxFor(model => model.PrivacySettings.EnableCookieConsent, new { data_toggler_for = "#pnlCookieConsent" }))
				@Html.ValidationMessageFor(model => model.PrivacySettings.EnableCookieConsent)
			</td>
		</tr>
		<tbody id="pnlCookieConsent">
			<tr>
				<td colspan="2">
					@(Html.LocalizedEditor<CustomerUserSettingsModel, CustomerUserSettingsLocalizedModel>("setting-privacy-localized",
						@<div class="adminContent">
							<div class="adminRow">
								<div class="adminTitle">
									@Html.SmartLabelFor(model => model.Locales[item].CookieConsentBadgetext)
								</div>
								<div class="adminData wide">
									@*IMPORTANT: Do not delete, this hidden element contains the id to assign localized values to the corresponding language *@
									@Html.HiddenFor(model => model.Locales[item].LanguageId)

									@Html.TextAreaFor(model => Model.Locales[item].CookieConsentBadgetext)
									@Html.ValidationMessageFor(model => model.Locales[item].CookieConsentBadgetext)
								</div>
							</div>
						</div>
						,
						@<div class="adminContent">
							<div class="adminRow">
								<div class="adminTitle">
									@Html.SmartLabelFor(model => model.PrivacySettings.CookieConsentBadgetext)
								</div>
								<div class="adminData wide">
									@Html.TextAreaFor(model => model.PrivacySettings.CookieConsentBadgetext)
									@Html.ValidationMessageFor(model => model.PrivacySettings.CookieConsentBadgetext)
								</div>
							</div>
						</div>
					))
				</td>
			</tr>
		</tbody>
	
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.PrivacySettings.StoreLastIpAddress)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.PrivacySettings.StoreLastIpAddress)
				@Html.ValidationMessageFor(model => model.PrivacySettings.StoreLastIpAddress)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.PrivacySettings.DisplayGdprConsentOnForms)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.PrivacySettings.DisplayGdprConsentOnForms)
				@Html.ValidationMessageFor(model => model.PrivacySettings.DisplayGdprConsentOnForms)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.PrivacySettings.FullNameOnContactUsRequired)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.PrivacySettings.FullNameOnContactUsRequired)
				@Html.ValidationMessageFor(model => model.PrivacySettings.FullNameOnContactUsRequired)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.PrivacySettings.FullNameOnProductRequestRequired)
			</td>
			<td class="adminData">
				@Html.SettingEditorFor(model => model.PrivacySettings.FullNameOnProductRequestRequired)
				@Html.ValidationMessageFor(model => model.PrivacySettings.FullNameOnProductRequestRequired)
			</td>
		</tr>
	</table>
}